<?php
/**
+++----视图模型 says与info
*/
class CategoryViewModel extends ViewModel {
   
    public $viewFields = array(

		 'categories'=>array('*' ,'_as'=>'c' ),
		
		 'categories_description'=>array('*','_as'=>'cd','_on'=>'c.categories_id=cd.categories_id'),
		
		 );


  //獲取所有信息
   public function getAll($where,$limit,$order){
		return $this->where($where)->limit($limit)->order($order)->select();
		
	}
  //獲取一條信息
   public function getOne($where){
		return $this->where($where)->find();
		
	}
	
  //获取所有商品分类
  public function getAllc($where,$order){
  	return $this->where($where)->order($order)->select();
  }
}

?>